package cn.yunyichina.provider.pay.service;

import cn.yunyichina.provider.iface.entity.dto.pacity.PacityUserInfoRequestDTO;
import org.springframework.util.StringUtils;

import java.util.Map;

/**
 * Created by Lullaby on 2017/6/15.
 */
public class BaseUserInfoService {

    protected boolean checkGetPacityUserInfoParameters(Map<String, String> params) {
        if (StringUtils.isEmpty(params.get("access_token"))) return false;
        if (StringUtils.isEmpty(params.get("scope"))) return false;

        return true;
    }

    protected PacityUserInfoRequestDTO buildGetPacityUserInfoRequestDTO(Map<String, String> params) {
        PacityUserInfoRequestDTO requestDTO = new PacityUserInfoRequestDTO();
        requestDTO.setAccessToken(params.get("access_token"));
        requestDTO.setScope(params.get("scope"));

        return requestDTO;
    }

}
